#ifndef TRANSLATEBOARD_H
#define TRANSLATEBOARD_H
#include "Headers.h"
#include "Figure.h"
#include "Field.h"
#include "PossibleMoves.h"
#include "GamesHistory.h"
#include "Console.h"

enum ChessPiece {r1 = 0, n1, b1, q, k, b2, n2, r2,
                 p1, p2, p3, p4, p5, p6, p7, p8,
                 P1, P2, P3, P4, P5, P6, P7, P8,
                 R1, N1, B1, Q, K, B2, N2, R2,
                 empty = -1};

class TranslateBoard
{
private:
    int board[8][8];
    QString figures[32];
    GamesHistory * history;
    void debug(int board[8][8]);

public:
    TranslateBoard(GamesHistory *history);
    void init();
    void translate();
    int toInt(QString string);
    QString toString(int integer);
    Move * movePawn(int moveNum, Move *move);
    bool checkRook(int oldL, int oldA, int newL, int newA);
    Move * moveRook(int moveNum, Move *move);
    Move * moveKnight(int moveNum, Move *move);
    Move * moveBishop(int moveNum, Move *move);
    Move * moveQueen(int moveNum, Move *move);
    Move * moveKing(int moveNum, Move *move);
    Move * castling(int moveNum, Move *move);
    ~TranslateBoard();
};

#endif // TRANSLATEBOARD_H
